<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />



<title>adwebmob</title>



<link rel="stylesheet" href="css/style.css" type="text/css" />



<?php



ob_start();



session_start();







include("UserIncludes/DbConfig.php");







//main_content("mainBuySpace();");







if(!isset($_SESSION[siteuserId]) || $_SESSION[siteuserId]=='')



	echo '<script>window.location="index.php"</script>';











// Start Coming from popup







$will_retrieve_id = 'update_'.$_GET['form_id'];







// end coming from pop







//Start Retrieve ad from adgroup_ad table for displaying



$query_retrieve = mysql_query("select * from temp_adgroup_ad where id  = '".$_GET['ad_id']."' ");



$row_query_retrieve = mysql_fetch_array($query_retrieve);



//end Retrieve ad from adgroup_ad table for displaying







if($_SESSION['langId']!="")



	{



		$langId=$_SESSION['langId'];



	}



	else



	{



		$langId="1";



	}











if(isset($_POST['hidden_field']) && $_POST['hidden_field'] == 'www')



{



$query_update = "UPDATE temp_adgroup_ad SET personal_reference = '".$_POST['txtAdName']."',dest_url = '".$_POST['txtUrl']."',ad_description = '".$_POST['text_description']."',heading = '".$_POST['txtHeadline']."' where id = '".$_GET['ad_id']."' ";







$res = mysql_query($query_update);



$inner_row = mysql_fetch_array($res);











$inner_res = mysql_query("select * from temp_adgroup_ad where id = '".$_GET['ad_id']."'");



$startTable = '<table width="100%" cellpaddin="0" cellspacing="0" border="1" >';



$endTable = '</table>';







$inner_row = mysql_fetch_array($inner_res);







	$rowStr .= '<tr id="new_adgroup_'.$inner_row['id'].'" style="cursor:pointer;" onclick="callOpenNewAdgroup('.$_GET[ad_id].');"><td >N&U</td><td>'.$inner_row['personal_reference'].'</td><td>'.$inner_row['heading'].'</td></tr>';



	







$finalResult = $startTable.$rowStr.$endTable;



?>







<script>



parent.window.opener.document.getElementById('new_row_id_<?=$_GET[ad_id]?>').innerHTML = '<?php echo $finalResult;?>' ;



self.close();



</script>







<?php







}















// to get the type of ad query



$get_type_id = $_SESSION['type_id'] ; //$_POST['typeid'];



$res_type_query = mysql_query("select adspaceType from adspace_details where adspaceId = '".$get_type_id."' ");



$row_type_query = mysql_fetch_array($res_type_query);







if(isset($_POST['post_checking'])){



$adtype_retrieve=$_POST['network_type'];



}



else



$adtype_retrieve=$row_type_query['adspaceType'];



// End to get the type of ad query







// For file upload coding







if ($_FILES["file"]["error"] > 0)



  {



 // echo "Error: " . $_FILES["file"]["error"] . "<br />";



  }



else



  {



  $file_name = $_FILES["file"]["name"];



  $extension = explode('.',$file_name);  



  move_uploaded_file($_FILES["file"]["tmp_name"],"upload/" . $_SESSION[siteuserId] .".".$ext
